package com.secxiot.consumer.user.feign;

/*@Component
public class UserFallFactory*//* implements FallbackFactory<UserClient> *//*{
    private static Logger LOG = LoggerFactory.getLogger(UserFallFactory.class);

    public UserClient create(Throwable throwable) {
        if (LOG.isDebugEnabled()) {
            LOG.error("Hytrix异常处理:\n" + throwable.getMessage(),throwable);
        }

        return new UserClient() {
            @Override
            public UserDo getUser(Long id) {
                if (throwable instanceof BaseRuntimeException) {
                    BaseRuntimeException ex = (BaseRuntimeException) throwable;
                    throw ex;
                }
                return null;
            }

            @Override
            public ResultVo<UserDo> getUserByPhone(String mobile) {
                return new ResultVo<>(ServerStatusEnum.SYSTEM_EXCEPTION);
            }

            @Override
            public ResultVo<UserDo> registry(UserDto userDto) {
                return new ResultVo<>(ServerStatusEnum.SYSTEM_EXCEPTION);
            }

            @Override
            public ResultVo<UserDo> update(UserDto userDto) {
                return new ResultVo<>(ServerStatusEnum.SYSTEM_EXCEPTION);
            }

            @Override
            public ResultVo<List<DataDictVo>> listDataDict(String parentCode) {
                return null;
            }
        };
    }
}*/
